package com.fruit.controller.wap.guide;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.fruit.controller.base.BaseController;
import com.fruit.pojo.version.AppVersion;
import com.fruit.service.edition.AppVersionManager;

@Controller
@RequestMapping(value = "/wap/guide")
public class GuideController extends BaseController{

	@Resource(name = "appVersionService")
	private AppVersionManager appVersionService;
	
	@RequestMapping
	public ModelAndView guide(){
		ModelAndView view = this.getModelAndView();
			Map<String, Object> params = new HashMap<String, Object>();
			params.put("appType", "Android");
			params.put("start", 0);
			params.put("showNumber", 1);
			List<AppVersion> android = appVersionService.getAppVersionInfo(params);
			params.put("appType", "iOS");
			List<AppVersion> ios = appVersionService.getAppVersionInfo(params);
			
			view.addObject("android", android.get(0));
			view.addObject("ios", ios.get(0));
		view.setViewName("guide/guide");
		return view;
	}
	
}
